package 测试.七月22日;

import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

            String a = in.next();
            String b = in.next();

        boolean rel = Search(a, b);
        if(rel){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
    public static boolean Search(String aa, String bb){
        char[] a = aa.toCharArray();
        char[] b = bb.toCharArray();
        int[] hash1 = new int[60];
        int kinds = 0;
        for(char c : b){
            if(hash1[c - 'A'] == 0){
                kinds++;
            }
            hash1[c - 'A'] ++;
        }
        int left = 0,right = a.length,count = 0;
        int[] hash2 = new int[60];
        while(left < right){
            char in = a[left++];
            hash2[in -'A']++;
            if(hash2[in - 'A'] == hash1[in - 'A'] && hash2[in - 'A'] != 0){
                count++;
            }
            if(count == kinds) return true;
        }
        return false;
    }
    public static boolean Search1(String aa, String bb) {
        HashMap<Character, Integer> hash1 = new HashMap<>();
        char[] b = bb.toCharArray();
        for(char c : b) {
            hash1.put(c,hash1.getOrDefault(c,0)+1);
        }
        char[] a = aa.toCharArray();
        HashMap<Character, Integer> hash2 = new HashMap<>();
        int left = 0,right = a.length>>1,count = 0;
        while(left < right){
            char in = a[left++];
            int numIn = hash2.getOrDefault(in,0);

            if(numIn < hash1.getOrDefault(in,0)){
                count++;
            }
            hash2.put(in,hash2.getOrDefault(in,0)+1);
            if(count == hash1.size()){
                return true;
            }
        }

        return false;
    }
}
